// 部门列表树
import React from 'react';
import PropTypes from 'prop-types';
import { TreeSelect, Spin } from 'antd';

const TreeComponent = React.forwardRef((props, ref) => (
    <div ref={ref}>
        <Spin spinning={props.loading}>
            <TreeSelect
                allowClear
                {...props}
            />
        </Spin>
    </div>
));

TreeComponent.propTypes = {
    treeData: PropTypes.array,
    loading: PropTypes.bool
};

TreeComponent.defaultProps = {
    treeData: [],
    loading: true
};

export default TreeComponent;
